package common

import (
	"oss-policy-go/common/httpStatus"
)

type ResponseData struct {
	Code httpStatus.ResCode `json:"code"`           //相应状态码
	Msg  string             `json:"msg"`            //提示信息
	Data interface{}        `json:"data,omitempty"` //数据
}

func SuccessData(data interface{}) *ResponseData {
	responseData := &ResponseData{Code: httpStatus.Success, Msg: httpStatus.Success.Msg(), Data: data}
	return responseData
}

func ErrorMsg(msg string) *ResponseData {
	responseData := &ResponseData{Code: httpStatus.Error, Msg: msg}
	return responseData
}
